﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="MantReclamo.aspx.cs" Inherits="DECOR.WebApp.MantReclamo" Title="Crystalis Consulting" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<%@ Register assembly="IdeaSparx.CoolControls.Web" namespace="IdeaSparx.CoolControls.Web" tagprefix="cc2" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style2
        {
            width: 26px;
        }
        .style3
        {
            width: 277px;
        }
        .style4
        {
            width: 158px;
        }
        .style5
        {
            width: 117px;
        }
        .style6
        {
            width: 266px;
        }
        .style7
        {
            height: 64px;
        }
        .style8
        {
            width: 266px;
            height: 64px;
        }
        .style9
        {
            height: 30px;
        }
    </style>
    <script type="text/javascript" language="JavaScript">
        function capturaValStatus(combo)
        {
            var indice = combo.selectedIndex;
            var valor = combo.options[combo.selectedIndex].text;
            var asd = $get('<%= lblStatus.ClientID %>').id;
            var tmp = document.getElementById(asd);
            tmp.innerHTML = valor;
            var cmbStatusVisita =  $get('<%= DropDownListStatusVisita.ClientID %>');
            cmbStatusVisita.selectedIndex = indice;
            var txtDescrip =  $get('<%= txtDescripcion.ClientID %>');
            txtDescrip.value = "";
            
            var label = $get('<%= LabelLeyenda.ClientID %>').id;
            var tmplabel = document.getElementById(label);
            if(cmbStatusVisita.value == 3)
            {
                tmplabel.innerHTML = "Máximo 250 caracteres.";
            }
            else
            {
                tmplabel.innerHTML = "Máximo 150 caracteres.";
            }
        }        
        
        function ValidarCaracteres(textareaControl,maxlength)
        {
            var cmbStatusVisita =  $get('<%= DropDownListStatusVisita.ClientID %>');
            
            if(cmbStatusVisita.value == 3)
            {
                if (textareaControl.value.length > maxlength){
                    textareaControl.value = textareaControl.value.substring(0,maxlength);
                }                
            }
            else        
            {
                if (textareaControl.value.length > 150){
                    textareaControl.value = textareaControl.value.substring(0,150);
                }                
            }
        }        
    </script>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphHeader" runat="server">
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="cphTopMenu" runat="server">
    <asp:UpdatePanel ID="upBotones" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false">
    <ContentTemplate>
        <asp:ImageButton ID="btnCrear" runat="server" ImageUrl="~/img/new.png" 
                    AlternateText="Crear doc ventas" ToolTip="Crear doc ventas" 
            onclick="btnCrear_Click" />&nbsp;
        <asp:ImageButton ID="btnEditar" runat="server" ImageUrl="~/img/edit.png" 
                    AlternateText="Modificar doc ventas" ToolTip="Modificar doc ventas" 
            onclick="btnEditar_Click" />&nbsp;
        <asp:ImageButton ID="btnVer" runat="server" ImageUrl="~/img/view.png" 
                    AlternateText="Vizualizar" ToolTip="Vizualizar" 
                    OnClick="btnVer_Click" />&nbsp;
        <asp:ImageButton ID="btnGrabar" runat="server" 
            AlternateText="Grabar reclamo" ImageUrl="~/img/save.dis.png" 
            OnClick="btnGrabar_Click" ToolTip="Grabar reclamo" />
        &nbsp; &nbsp; 
                
        <asp:ImageButton ID="btnValidar" runat="server" ImageUrl="~/img/verify.dis.png" 
               AlternateText="Validar Datos" ToolTip="Validar Datos" onclick="btnValidar_Click" Enabled="false"/> &nbsp;                
            
        <asp:ImageButton ID="btnImprimir" runat="server" ImageUrl="~/img/print.png" 
                    AlternateText="Imprimir doc ventas" ToolTip="Imprimir doc ventas" OnClick="btnImprimir_Click"/>&nbsp;
                    
        <asp:ImageButton ID="btnCancel" runat="server" AlternateText="Cancelar" 
            Enabled="true" ImageUrl="~/img/cancel.dis.png" OnClick="btnCancel_Click" 
            ToolTip="Cancelar operación" />
                    
    </ContentTemplate>
    </asp:UpdatePanel>
    
</asp:Content>

<asp:Content ID="Content6" ContentPlaceHolderID="cphTopContent" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="cphMain" runat="server">
    <link href="css/controls.css" rel="stylesheet" type="text/css" />
    <asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
        <ContentTemplate>

            <table id="Table3" class="tbl-params" border="0" cellpadding="2" cellspacing="2">
                <tr>
                    <td style="text-align:left; vertical-align:top;">
                        <asp:Label ID="label1" runat="server" Text="Nro Reclamo: " />
                        <asp:TextBox ID="txtNumReclamo" runat="server" Text="" CssClass="inputbox" Width="200" MaxLength="10" />
                        <cc1:FilteredTextBoxExtender ID="fteNumPedido" runat="server" TargetControlID="txtNumReclamo"
                                        FilterType="Numbers" />
                    </td>
                </tr>
            </table>
        
            <div style="height:10px"></div>
        
            <cc1:TabContainer ID="tcMain" runat="server" TabStripPlacement="Top" ActiveTabIndex="0" 
                    Height="320px" Enabled="false" Width="973px">
                <cc1:TabPanel ID="tpCabecera" runat="server" >
                    <HeaderTemplate>Descripción</HeaderTemplate>
                    <ContentTemplate>

                    <table id="htbParams" class="tbl-params" border="0" cellpadding="1" cellspacing="1" 
                    
                            style="width:969px; height:auto; ">
                                                        <script type="text/javascript" language="javascript">
                                function getCodigo(source, eventArgs)
                                {
                                    $get('<%= txtEmpresa.ClientID %>').value = eventArgs.get_value();
                                    
                                }                                 
                                
                            </script>

                            <tr>
                                 <td>
                                    <table class="tbl-params" style="width:250px; height:140px">
                                        <tr>
                                            <td >
                                                Fecha Contacto</td>
                                            <td>
                                                <asp:TextBox ID="txtFechaI" runat="server" Width="70px" CssClass="inputbox" 
                                                    Font-Size="10pt" ReadOnly="True" />&nbsp;&nbsp;<asp:TextBox ID="txtFechaF" 
                                                    runat="server" Width="70px" CssClass="inputbox" Font-Size="10pt" 
                                                    ReadOnly="True" ></asp:TextBox>
                                                
                                                <cc1:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="txtFechaI"
                                                    Format="dd/MM/yyyy" CssClass="MyCalendar" Enabled="True">
                                                </cc1:CalendarExtender>
                                                <cc1:CalendarExtender ID="CalendarExtender2" runat="server" TargetControlID="txtFechaF"
                                                    Format="dd/MM/yyyy" CssClass="MyCalendar" Enabled="True">
                                                </cc1:CalendarExtender>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                Hora Contacto</td>
                                            <td>
                                                <asp:TextBox ID="txtHoraReclamoI"  runat="server" Width="70px" Font-Size="10pt" 
                                                    ReadOnly="True"></asp:TextBox>&nbsp;&nbsp;<asp:TextBox ID="txtHoraReclamoF" 
                                                    runat="server" Font-Size="10pt" Width="70px" ReadOnly="True"></asp:TextBox>                                            
                                                
                                                </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2" class="style9">
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  </td>
                                        </tr>
                                        </table>
                                </td>
                                 <td >
                                    <table class="tbl-params" style="width:424px; height:131px">
                                        <tr>
                                            <td class="style5">
                                                </td>
                                            <td class="style2" >
                                                Código</td>
                                            <td class="style4" >
                                                   Razón Social</td>
                                        </tr>
                                        <tr>
                                            <td class="style5">
                                                Cliente<br />
                                                <asp:LinkButton ID="lnkShowInterlocutores" runat="server" 
                                                    Text="Datos del Cliente (Interlocutores)" Width="100px"></asp:LinkButton>
                                            </td>
                                            <td class="style2">
                                                <asp:TextBox ID="txtEmpresa" runat="server" AutoCompleteType="Company" 
                                                    CssClass="inputbox" MaxLength="11" Width="70px"
                                                        AutoPostBack="True" OnTextChanged="txtInterlocutores_TextChanged"></asp:TextBox>
                                                <cc1:FilteredTextBoxExtender ID="ftbeEmpresa" runat="server" Enabled="True" 
                                                    FilterType="Numbers" TargetControlID="txtEmpresa">
                                                </cc1:FilteredTextBoxExtender>
                                            </td>
                                            <td class="style4">
                                    <asp:TextBox ID="txtNomCliente" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                                Width="200px" AutoPostBack="True" />
                                    <cc1:AutoCompleteExtender ID="aceNomCliente" runat="server" TargetControlID="txtNomCliente"
                                        MinimumPrefixLength="1" CompletionInterval="100" CompletionSetCount="15"
                                        CompletionListCssClass="autocomplete_completionListElement"
                                        CompletionListItemCssClass="autocomplete_listItem"
                                        CompletionListHighlightedItemCssClass="autocomplete_highlightedListItem"
                                        DelimiterCharacters=""
                                        ServiceMethod="buscaClientes2"
                                        OnClientItemSelected="getCodigo" Enabled="True" ServicePath="">
                                    </cc1:AutoCompleteExtender>

                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style5" >
                                                Código de Asesor
                                                <br />
                                            </td>
                                            <td class="style2">
                                                <asp:TextBox ID="txtEmpResp" runat="server" Width="70px"
                                                        AutoPostBack="True" OnTextChanged="txtInterlocutores_TextChanged"></asp:TextBox>
                                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender20" runat="server" 
                                                    Enabled="True" FilterType="Numbers" TargetControlID="txtEmpResp">
                                                </cc1:FilteredTextBoxExtender>
                                                
                                            </td>
                                            <td class="style4">
                                                <asp:TextBox ID="lblEmpResp" runat="server" Width="203px" ReadOnly="True"
                                                    ></asp:TextBox>
                                     
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="style5"  >
                                                <asp:LinkButton ID="lnkTextos" runat="server" Text="Datos de Reclamo"></asp:LinkButton>
                                            </td>
                                            <td class="style2" >
                                                <asp:TextBox ID="txtPersonaContacto" runat="server" Width="70px"  OnTextChanged="txtInterlocutores_TextChanged"
                                                    Visible="False"></asp:TextBox>
                                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" 
                                                    Enabled="True" FilterType="Numbers" TargetControlID="txtPersonaContacto">
                                                </cc1:FilteredTextBoxExtender>
                                            </td>
                                            <td class="style4" >
                                                         <asp:Label ID="lblPersonaContacto" runat="server" Width="100px" Visible="False"></asp:Label>
                                                         </td>
                                        </tr>
                                        </table>
                                        
                                </td>
                                 <td class="style3" >
                                        
                                        <table class="tbl-params" style="width:283px; height:139px">
                                        <tr>
                                            <td >
                                                Motivo de reclamo </td>
                                            <td  >
                                                <asp:DropDownList ID="ddlMotivo" runat="server" Width="136px">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                Status</td>
                                            <td  >
                                                <asp:LinkButton ID="lnkCambiarStatus" runat="server" Text="Cambiar Status" />
                                                <asp:Label ID="lblStatus" runat="server"></asp:Label> 
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                Resultado</td>
                                            <td  >
                                                <asp:DropDownList ID="ddlResultado" runat="server" Width="136px" 
                                                    AutoPostBack="True" OnSelectedIndexChanged="ddlResultado_SelectedIndexChanged" >
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                JustificResul</td>
                                            <td  >
                                                <asp:DropDownList ID="ddlJustificResul" runat="server" Width="136px">
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        </table>
                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="tbl-params">
                                    <table class="tbl-params" style="width:250px; height:140px">
                                        <tr>
                                            <td  >
                                                Nro. Pedido</td>
                                            <td >
                                                <asp:TextBox ID= "txtNroPedido" runat="server"  Width="100px"
                                                        AutoPostBack="True" OnTextChanged="txtMateriales_TextChanged"></asp:TextBox>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender21" runat="server" TargetControlID="txtNroPedido"
                                        FilterType="Numbers" Enabled="True" />
                                                <asp:Label ID= "lblNroPedido" runat="server"  Width="70px"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                Material 1</td>
                                            <td>
                                                <asp:TextBox ID="txtMaterial" runat="server" Width="100px"
                                                 AutoPostBack="True" OnTextChanged="txtMateriales_TextChanged"></asp:TextBox>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender22" runat="server" TargetControlID="txtMaterial"
                                        FilterType="Numbers" Enabled="True" />
                                                <asp:Label ID= "lblMaterial1" runat="server"  Width="70px"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                Material 2</td>
                                            <td>
                                                <asp:TextBox ID="txtMaterial2" runat="server" Width="100px"
                                                 AutoPostBack="True" OnTextChanged="txtMateriales_TextChanged"></asp:TextBox>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" TargetControlID="txtMaterial2"
                                        FilterType="Numbers" Enabled="True" />
                                                <asp:Label ID= "lblMaterial2" runat="server"  Width="70px"/>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td >
                                                Reclamo Ref.</td>
                                            <td>
                                                <asp:TextBox ID="txtReclaRef" runat="server" Width="100px" MaxLength="30"></asp:TextBox>
                                                <asp:Label ID= "lblReclaRef" runat="server"  Width="70px" />
                                            </td>
                                        </tr>
                                        </table>
                                    
                                </td>
                                <td class="tbl-params" colspan="2">
                                    <table class="tbl-params"  style="width:708px; height:140px">
                                        <tr>
                                            <td class="style7">
                                                Org de venta</td>
                                            <td class="style7">
                                                <asp:DropDownList ID="ddlOrgVenta" runat="server" Width="188px">
                                                </asp:DropDownList>
                                            </td>
                                            <td class="style7">
                                                Oficina Ventas</td>
                                            <td class="style8" >
                                                <asp:DropDownList ID="ddlOfiVenta" runat="server" 
                                                    Width="188px" >
                                                </asp:DropDownList>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="tbl-params">
                                                Canal</td>
                                            <td class="tbl-params">
                                                <asp:DropDownList ID="ddlCanal" runat="server" Width="188px">
                                                </asp:DropDownList>
                                            </td>
                                            <td class="tbl-params">
                                                Factura / Boleta</td>
                                            <td class="style6" >
                                                
                                                <asp:TextBox ID="txtComantario" runat="server" Width="265px" MaxLength ="40"></asp:TextBox>
                                                
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="tbl-params">
                                                Sector</td>
                                            <td class="tbl-params">
                                                <asp:DropDownList ID="ddlSector" runat="server" Width="188px">
                                                </asp:DropDownList>
                                            </td>
                                            <td class="tbl-params">
                                                &nbsp;</td>
                                            <td class="style6" >
                                                &nbsp;</td>
                                        </tr>
                                    </table>
                                    
                                </td>
                            </tr> 
                        </table>                    
                    
                     <!- INTERLOCUTORES------------->          
                                   
                        <cc1:ModalPopupExtender ID="mpeInterlocutores" runat="server" TargetControlID="lnkShowInterlocutores"
                                    PopupControlID="pnlInterlocutores" CancelControlID="btnClose"
                                    BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlTitulo" 
                                    DynamicServicePath="" Enabled="True" />

                        <asp:Panel ID="pnlInterlocutores" runat="server" ScrollBars="Auto" 
                            Width="902px" CssClass="modalPopup">
                            <asp:Panel ID="pnlTitulo" runat="server" Width="840px" BackColor="LightBlue" 
                                HorizontalAlign="Center">
                                <asp:Label ID="lblDetalleInterlocuroes" runat="server" 
                                    Text="Interlocutor" BackColor="LightBlue" Width="100%" />
                            </asp:Panel>                               
                              
                              
                                         
                              <table class="tbl-detalle">
                                <tr>
                                    <th style="width: 120px;">Func. interl.</th>
                                    <th style="width: 120px;">&nbsp;</th>
                                    <th style="width:80px;">Interl.</th>
                                    <th style="width:200px;">Nom.</th>
                                    <th style="width:200px;">Calle</th>
                                    <th style="width:180px;">Ubicación</th>
                                    <th class="style1">Telefono</th>
                                    <th class="style1">NIF</th>
                                </tr>
                                <tr><td style="height:20px; vertical-align:middle;" colspan="8"><hr /></td></tr>
                                
                                <tr>
                                    <td style="text-align:left;">
                                        Cliente (AG)</td>
                                    <td style="text-align:left;">
                                        &nbsp;</td>
                                    <td style="text-align:left;">
                                        <asp:TextBox ID="txtEmpresaDet" runat="server" CssClass="inputbox" MaxLength="10" 
                                            AutoCompleteType="Company" Width="80px" Enabled="False" />
                                        <cc1:FilteredTextBoxExtender ID="ftbeCodSolicitante" runat="server" TargetControlID="txtEmpresaDet"
                                                FilterType="Numbers" Enabled="True" />
                                    </td>
                                    <td style="text-align:center;">
                                    <asp:TextBox runat="server" AutoCompleteType="Disabled" MaxLength="70"
                                     CssClass="inputbox" Enabled="False" Width="180px" ID="txtNomEmpresa"></asp:TextBox>
                                    
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtDirEmpresa" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                                    Width="180px" Enabled="False" MaxLength="60" />
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:DropDownList ID="ddlCodpEmpresa" runat="server" Width="180px" 
                                            Enabled="False" />
                                    </td>
                                    <td style="text-align:center;" >
                                        <asp:TextBox ID="txtTelfEmpre" runat="server" CssClass="inputbox" MaxLength="10" 
                                            AutoCompleteType="Company" Width="80px" Enabled="False" />
                                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender3" runat="server" TargetControlID="txtTelfEmpre"
                                                FilterType="Numbers" Enabled="True" />
                                    </td>
                                    <td style="text-align:center;" >
                                        <asp:TextBox ID="txtNIF" runat="server" CssClass="inputbox" MaxLength="11" 
                                            AutoCompleteType="Company" Width="80px" Enabled="False" />
                                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender13" runat="server" TargetControlID="txtNIF"
                                                FilterType="Numbers" Enabled="True" />
                                    </td>
                                </tr>
                                
                                <tr>
                                    <td style="text-align:left;">
                                        Persona de contacto (AP)</td>
                                    <td style="text-align:left;">
                                        &nbsp;</td>
                                    <td style="text-align:left;">
                                        &nbsp;</td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtNomPContac" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                                    Width="180px" MaxLength="40"/>
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtDirPContac" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                                    Width="180px" MaxLength="60"/>
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:DropDownList ID="ddlCodpPContac" runat="server" Width="180px"/>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTelfCont" runat="server" AutoCompleteType="Company" 
                                            CssClass="inputbox" MaxLength="10" Width="80px"></asp:TextBox>
                                        <cc1:FilteredTextBoxExtender ID="txtTelfEmpre0_FilteredTextBoxExtender" 
                                            runat="server" Enabled="True" FilterType="Numbers" 
                                            TargetControlID="txtTelfCont">
                                        </cc1:FilteredTextBoxExtender>
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtNIFCont" runat="server" AutoCompleteType="Company" 
                                            CssClass="inputbox" MaxLength="11" Width="80px"></asp:TextBox>
                                        <cc1:FilteredTextBoxExtender ID="txtTelfEmpre1_FilteredTextBoxExtender" 
                                            runat="server" Enabled="True" FilterType="Numbers" 
                                            TargetControlID="txtNIFCont">
                                        </cc1:FilteredTextBoxExtender>
                                    </td>
                                </tr>
                                                                
                                <tr>
                                    <td style="text-align:left;">
                                        Código de Asesor (ZM)</td>
                                    <td style="text-align:left;">
                                        &nbsp;</td>
                                    <td style="text-align:left;">
                                        <asp:TextBox ID="txtCodResPago" runat="server" CssClass="inputbox" MaxLength="10" 
                                            AutoCompleteType="Company" Width="80px"/>
                                        <cc1:FilteredTextBoxExtender ID="ftbeCodResPago" runat="server" 
                                                TargetControlID="txtCodResPago" FilterType="Numbers" Enabled="False" />
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtNomResPago" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                                    Width="180px" MaxLength="70"  Enabled="False"/>
                                        
                                    </td>
                                    <td style="text-align:center;">
                                        Correo (AG)</td>
                                    <td style="text-align:left;" colspan="2">
                                        <asp:TextBox ID="txtEMail" runat="server" AutoCompleteType="Disabled" 
                                            CssClass="inputbox" MaxLength="35" Width="180px"></asp:TextBox>
                                    </td>
                                    <!-- NIF Resp Pago -->
                                    <td>&nbsp;</td>
                                </tr>
                                
                                <tr>
                                    <td style="text-align:left;">
                                        Enc. Comercial (VE)
                                    </td>
                                    <td style="text-align:left;">
                                        &nbsp;</td>
                                    <td style="text-align:left;">
                                        <asp:TextBox ID="txtCodECom" runat="server" CssClass="inputbox" MaxLength="10" 
                                            AutoCompleteType="Company" Width="80px" Enabled="False" />
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtNomECom" runat="server" CssClass="inputbox" AutoCompleteType="Disabled"
                                                    Width="180px" Enabled="False" />
                                    </td>
                                    <td style="text-align:center;">
                                        &nbsp;
                                    </td>
                                    <td style="text-align:center;">
                                        &nbsp;
                                    </td>
                                </tr>
                                
                                
                                <tr>
                                    <td style="text-align:left;">
                                        </td>
                                    <td style="text-align:left;">
                                        &nbsp;</td>
                                    <td style="text-align:left;">
                                        <asp:TextBox ID="txtCodDestMerc" runat="server" CssClass="inputbox" MaxLength="10" 
                                            AutoCompleteType="Company" Width="80px" AutoPostBack="True" Visible="False"
                                            OnTextChanged="txtInterlocutores_TextChanged"/>
                                        <cc1:FilteredTextBoxExtender ID="ftbeCodDestMerc" runat="server" TargetControlID="txtCodDestMerc"
                                                FilterType="Numbers" Enabled="True" />
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtNomDestMerc" runat="server" CssClass="inputbox" 
                                            AutoCompleteType="Disabled"  Visible="False"
                                                    Width="180px" MaxLength="70"/>
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:TextBox ID="txtDirDestMerc" runat="server" CssClass="inputbox" 
                                            AutoCompleteType="Disabled" Visible="False"
                                                    Width="180px" MaxLength="35"/>
                                    </td>
                                    <td style="text-align:center;">
                                        <asp:DropDownList ID="ddlCodpDestMerc" runat="server" Width="180px"  
                                            Visible="False"/>
                                    </td>
                                </tr>
                            </table>

      
    
                            <div style="width:100%; text-align:right; padding-top:5px;">
                                <asp:ImageButton ID="btnGrabarInterlocutores" runat="server" ImageUrl="~/img/ok16.png" 
                                                ImageAlign="Middle" OnClick="btnGrabarInterlocutores_Click" />
                                <asp:ImageButton ID="btnClose" runat="server" ImageUrl="~/img/cancel16.png" 
                                                ImageAlign="Middle" />
                            </div>

                        </asp:Panel>

                        <!- TEXTOS--------------------->

                        <cc1:ModalPopupExtender ID="mpeTextos" runat="server" TargetControlID="lnkTextos"
                                    PopupControlID="pnlTextos" CancelControlID="btnCloseTextos"
                                    BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlTituloTextos" 
                                    DynamicServicePath="" Enabled="True" />

                        <asp:Panel ID="pnlTextos" runat="server" ScrollBars="Auto" Width="1000px" CssClass="modalPopup">
                            <asp:Panel ID="pnlTituloTextos" runat="server" Width="1000px" 
                                BackColor="LightBlue" HorizontalAlign="Center">
                                <asp:Label ID="Label2" runat="server" Text="Detalle de Textos" 
                                        BackColor="LightBlue" Width="100%" />
                            </asp:Panel>
                            
                            <cc1:TabContainer ID="tcTextos" runat="server" 
                                ActiveTabIndex="0" CssClass="">
                                <cc1:TabPanel ID="tpTextoTratemInicial" runat="server" ><HeaderTemplate>Tratam. Inicial</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoTratemInicial" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoNotaDireccion" runat="server"><HeaderTemplate>Nota de Direccion</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoNotaDireccion" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                        	    <cc1:TabPanel ID="tpTextoSeguimiento" runat="server" ><HeaderTemplate>Seguimiento</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoSeguimiento" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoDiagnostico" runat="server" ><HeaderTemplate>Diagnostico</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoDiagnostico" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoSolucion" runat="server" ><HeaderTemplate>Solución</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoSolucion" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoPersonaContacto" runat="server"  ><HeaderTemplate>Persona de Contacto</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoPersonaContacto" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoDatosFacturacion" runat="server"><HeaderTemplate>Datos de Facturacion</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoDatosFacturacion" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoPedidoReferencia" runat="server"  ><HeaderTemplate>Pedido de Referencia</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoPedidoReferencia" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>
                                <cc1:TabPanel ID="tpTextoMotivosOtros" runat="server"><HeaderTemplate>Información a Servicio Interno</HeaderTemplate><ContentTemplate><asp:TextBox ID="txtTextoMotivosOtros" runat="server" Columns="90" Rows="10" TextMode="MultiLine" /></ContentTemplate></cc1:TabPanel>           
                                </cc1:TabContainer>
                            
                            <div style="width:100%; text-align:right; padding-top:5px;">
                                <asp:ImageButton ID="btnCloseTextos" runat="server" ImageUrl="~/img/ok16.png" ImageAlign="Middle" />
                            </div>
                        </asp:Panel>

                        <!- VENTA DE CAMBIO DE STATUS--------------------->            

                        <cc1:ModalPopupExtender ID="mpeCambiarStatus" runat="server" TargetControlID="lnkCambiarStatus"
                                    PopupControlID="pnlCambiarStatus" CancelControlID="btnCloseCambiarStatus"
                                    BackgroundCssClass="modalBackground" PopupDragHandleControlID="pnlTituloCambiarStatus" 
                                    DynamicServicePath="" Enabled="True" />

                        <asp:Panel ID="pnlCambiarStatus" runat="server" ScrollBars="Auto" Width="390px" CssClass="modalPopup">
                            <asp:Panel ID="pnlTituloCambiarStatus" runat="server" Width="393px" 
                                BackColor="LightBlue" HorizontalAlign="Center">
                                <asp:Label ID="Label3" runat="server" Text="Status" 
                                        BackColor="LightBlue" Width="100%" />
                            </asp:Panel>
                            
                                <table style="width: 100%;" class ="tbl-params">
                                    <tr style="width: 150px">
                                        <td>
                                            Status
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="ddlStatus" runat="server" Width ="200px">
                                            </asp:DropDownList>                                            
                                        </td>
                                    </tr>
                                    <tr style="width: 150px">
                                        <td>
                                            Persona
                                        </td>
                                        <td>
                                           <asp:TextBox ID="txtUsuarioStatus" runat="server" Width="200px"></asp:TextBox>                                           
                                        </td>
                                    </tr>
                                    <tr style="width: 150px">
                                        <td>
                                            Fecha de Realización
                                        </td>
                                        <td>
                                                <asp:TextBox ID="txtFechaSts" runat="server" Width="70px" CssClass="inputbox" 
                                                    Font-Size="10pt" />
                                                <cc1:CalendarExtender ID="ceFechaSts" runat="server" TargetControlID="txtFechaSts"
                                                    Format="dd/MM/yyyy" CssClass="MyCalendar" Enabled="True">
                                                </cc1:CalendarExtender>
                                        </td>
                                    </tr>
                                    <tr style="width: 150px">
                                        <td colspan="2">
                                            Descripción
                                        </td>                                       
                                    </tr>
                                    <tr style="width: 150px">
                                        <td>
                                           
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtDescripcion" runat="server" TextMode="MultiLine" Width="200px" Height="100px"></asp:TextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            
                                        </td>
                                        <td>                                            
                                            <asp:Label ID="LabelLeyenda" runat="server" Text=""></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            
                            <div style="width:100%; text-align:right; padding-top:5px;">
                                <asp:ImageButton ID="btnCloseCambiarStatus" runat="server" 
                                    ImageUrl="~/img/ok16.png" ImageAlign="Middle"/>
                            </div>
                        </asp:Panel>
      
                        
                    </ContentTemplate>
                </cc1:TabPanel>
                <cc1:TabPanel ID="tpVisitas" runat="server" Height="320px">
                    <HeaderTemplate>Visitas</HeaderTemplate>
                    <ContentTemplate>
                            <table  style="width: 100%;" class ="tbl-params">
                                <tr>
                                    <td>
                                        <asp:ImageButton ID="ImageButtonAnadir" runat="server" ImageUrl="~/img/edit.png" 
                                            AlternateText="Añadir y Modificar" ToolTip="Añadir y Modificar" 
                                            onclick="ImageButtonAnadir_Click" />&nbsp;
                                        <asp:ImageButton ID="ImageButtonCancelar" runat="server" ImageUrl="~/img/cancel.png" 
                                            AlternateText="Cancelar" ToolTip="Cancelar" 
                                            onclick="ImageButtonCancelar_Click" />&nbsp;
                                        <asp:ImageButton ID="ImageButtonGuardar" runat="server" ImageUrl="~/img/save.png" 
                                            AlternateText="Guardar" ToolTip="Guardar" 
                                            onclick="ImageButtonGuardar_Click" />&nbsp;
                                    </td>
                                </tr>
                            </table>
                            <table  style="width: 100%;" class ="tbl-params">
                            <tr>
                                <td>
                                    Código:
                                </td>
                                <td>
                                    <asp:Label ID="txtIdVisita" runat="server" Width="70px" ></asp:Label>
                                </td>
                                <td>
                                    Estado:
                                </td>
                                <td>
                                    <asp:DropDownList ID="DropDownListStatusVisita" runat="server">
                                    </asp:DropDownList>
                                </td>
                                <td colspan="2"></td>
                            </tr>
                            <tr>
                                <td>
                                    Fecha:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBoxFechaVisita" runat="server" Width="70px" CssClass="inputbox" 
                                                    Font-Size="10pt" />
                                    <cc1:CalendarExtender ID="CalendarExtender3" runat="server" TargetControlID="TextBoxFechaVisita"
                                        Format="dd/MM/yyyy" CssClass="MyCalendar" Enabled="True">
                                    </cc1:CalendarExtender>
                                </td>
                                <td>
                                    Hora:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBoxHoraVisita" runat="server" Width="70px" CssClass="inputbox" 
                                                    Font-Size="10pt" />
                                    <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" 
                                        TargetControlID="TextBoxHoraVisita" CultureAMPMPlaceholder="" 
                                        CultureCurrencySymbolPlaceholder="" CultureDateFormat="" 
                                        CultureDatePlaceholder="" CultureDecimalPlaceholder="" 
                                        CultureThousandsPlaceholder="" CultureTimePlaceholder="" Enabled="True" 
                                        Mask="99:99" MaskType="Time" UserTimeFormat="TwentyFourHour" >
                                    </cc1:MaskedEditExtender>
                                </td>
                                <td>
                                    Responsable:
                                </td>
                                <td>
                                    <asp:TextBox ID="TextBoxResponsableVisita" runat="server" Width="85%" CssClass="inputbox" 
                                                    Font-Size="10pt" MaxLength="70" />
                                    
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Comentario:
                                </td>
                                <td colspan="5">
                                    <asp:TextBox ID="TextBoxComentarioVisita" runat="server" Width="95%" CssClass="inputbox" Height="40px"
                                                    Font-Size="10pt" TextMode="MultiLine" />
                                </td>
                            </tr>
                            </table>
                            <div style="vertical-align:middle;">
                                <cc2:CoolGridView ID="GridViewVisitas" runat="server" EmptyDataText="No se encontraron registros"
                                    AutoGenerateColumns="False"  Height="150px" Width="100%" CssClass="tbl-materiales"
                                    OnRowCommand="GridViewVisitas_RowCommand" DataKeyNames="KTAST,COMENT">
                                    <%--<AlternatingRowStyle CssClass="alt" />--%>
                                    <Columns>
                                        <asp:ButtonField ButtonType="Image" CommandName="SelVisita"
                                            ImageUrl="~/img/edit.png" HeaderStyle-Width="20px" >
                                            <HeaderStyle Height="20px" />
                                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="20px" />
                                        </asp:ButtonField>
                                        <asp:BoundField DataField="NROVIS" HeaderText="Nro.Vis." HeaderStyle-Width="120px">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="FECHA" HeaderText="Fecha" DataFormatString="{0:dd-MM-yyyy}" HeaderStyle-Width="100px">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="TIME" HeaderText="Hora"  HeaderStyle-Width="90px">
                                            <ItemStyle HorizontalAlign="Center" />
                                        </asp:BoundField>
                                        <asp:BoundField DataField="DESCKTAST" HeaderText="Estado"  HeaderStyle-Width="150px" />
                                        <asp:BoundField DataField="RESP" HeaderText="Responsable"  HeaderStyle-Width="400px"/>
                                    </Columns>
                                    <HeaderStyle BackColor="Silver" Wrap="True"  />
                                    <BoundaryStyle BorderColor="Gray" BorderStyle="Solid" BorderWidth="1px" />
                                </cc2:CoolGridView>
                            </div>                 
                            <%--<br />--%>
                            <asp:HiddenField ID="HiddenFieldIndiceSeleccionado" runat="server"  />
                    </ContentTemplate>
                </cc1:TabPanel>
            </cc1:TabContainer>        
        </ContentTemplate>
        
    </asp:UpdatePanel>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
